package games.mapacman.common;

import games.mapacman.server.MaPacmanZone;
import marauroa.common.game.RPObject;

public abstract class Sign {

	protected int disappear;
	protected RPObject myObject;
	protected MaPacmanZone zone;

	public RPObject getRPObject() {
		return myObject;
	}

	public int getX() {
		return myObject.getInt("x");
	}

	public int getY() {
		return myObject.getInt("y");
	}

	public boolean checkDelete() {
		myObject.put("delete", myObject.getInt("delete") - 1);
		zone.getWorld().modify(myObject);
		return (myObject.getInt("delete") < 1);
	}

	public boolean valid() {
		return (disappear > 0);
	}

}
